{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from scipy import stats\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.数据读取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_data = pd.read_csv(\"D:\\\\GIT\\\\ml_dl\\\\ml\\\\classify\\\\bearing\\\\train.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_data = pd.read_csv(\"D:\\\\GIT\\\\ml_dl\\\\ml\\\\classify\\\\bearing\\\\test_data.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>5992</th>\n",
       "      <th>5993</th>\n",
       "      <th>5994</th>\n",
       "      <th>5995</th>\n",
       "      <th>5996</th>\n",
       "      <th>5997</th>\n",
       "      <th>5998</th>\n",
       "      <th>5999</th>\n",
       "      <th>6000</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.563650</td>\n",
       "      <td>1.069229</td>\n",
       "      <td>-0.837759</td>\n",
       "      <td>-1.122021</td>\n",
       "      <td>0.433296</td>\n",
       "      <td>0.770755</td>\n",
       "      <td>-0.477153</td>\n",
       "      <td>-0.588421</td>\n",
       "      <td>0.455224</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.050761</td>\n",
       "      <td>0.220506</td>\n",
       "      <td>0.036548</td>\n",
       "      <td>-0.097461</td>\n",
       "      <td>-0.084060</td>\n",
       "      <td>-0.007716</td>\n",
       "      <td>-0.049949</td>\n",
       "      <td>-0.018274</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.061333</td>\n",
       "      <td>0.058830</td>\n",
       "      <td>0.056952</td>\n",
       "      <td>0.068634</td>\n",
       "      <td>0.073433</td>\n",
       "      <td>0.072390</td>\n",
       "      <td>0.042975</td>\n",
       "      <td>-0.007302</td>\n",
       "      <td>-0.026286</td>\n",
       "      <td>...</td>\n",
       "      <td>0.061333</td>\n",
       "      <td>0.107437</td>\n",
       "      <td>0.104516</td>\n",
       "      <td>0.063419</td>\n",
       "      <td>-0.014394</td>\n",
       "      <td>-0.048607</td>\n",
       "      <td>-0.009388</td>\n",
       "      <td>0.058830</td>\n",
       "      <td>0.129342</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0.035736</td>\n",
       "      <td>0.010964</td>\n",
       "      <td>-0.164872</td>\n",
       "      <td>-0.167714</td>\n",
       "      <td>-0.125075</td>\n",
       "      <td>-0.104771</td>\n",
       "      <td>-0.016650</td>\n",
       "      <td>0.151471</td>\n",
       "      <td>0.137258</td>\n",
       "      <td>...</td>\n",
       "      <td>4.272044</td>\n",
       "      <td>-1.991455</td>\n",
       "      <td>-2.922208</td>\n",
       "      <td>1.937039</td>\n",
       "      <td>0.704156</td>\n",
       "      <td>-2.085667</td>\n",
       "      <td>0.203044</td>\n",
       "      <td>0.739892</td>\n",
       "      <td>-2.149829</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>-0.046700</td>\n",
       "      <td>0.060913</td>\n",
       "      <td>0.009340</td>\n",
       "      <td>-0.093400</td>\n",
       "      <td>-0.067817</td>\n",
       "      <td>0.022335</td>\n",
       "      <td>0.006091</td>\n",
       "      <td>-0.076751</td>\n",
       "      <td>-0.032893</td>\n",
       "      <td>...</td>\n",
       "      <td>0.095025</td>\n",
       "      <td>-0.000406</td>\n",
       "      <td>0.091776</td>\n",
       "      <td>0.074314</td>\n",
       "      <td>-0.082842</td>\n",
       "      <td>-0.110050</td>\n",
       "      <td>-0.028020</td>\n",
       "      <td>0.025990</td>\n",
       "      <td>-0.050355</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0.162922</td>\n",
       "      <td>-0.377662</td>\n",
       "      <td>0.014457</td>\n",
       "      <td>0.565437</td>\n",
       "      <td>-0.203369</td>\n",
       "      <td>-0.511508</td>\n",
       "      <td>0.410961</td>\n",
       "      <td>0.228546</td>\n",
       "      <td>-0.515244</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.093563</td>\n",
       "      <td>-0.263632</td>\n",
       "      <td>0.114517</td>\n",
       "      <td>0.209541</td>\n",
       "      <td>-0.184851</td>\n",
       "      <td>-0.075370</td>\n",
       "      <td>0.286211</td>\n",
       "      <td>0.005685</td>\n",
       "      <td>-0.223348</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 6002 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   id         1         2         3         4         5         6         7  \\\n",
       "0   1  0.563650  1.069229 -0.837759 -1.122021  0.433296  0.770755 -0.477153   \n",
       "1   2  0.061333  0.058830  0.056952  0.068634  0.073433  0.072390  0.042975   \n",
       "2   3  0.035736  0.010964 -0.164872 -0.167714 -0.125075 -0.104771 -0.016650   \n",
       "3   4 -0.046700  0.060913  0.009340 -0.093400 -0.067817  0.022335  0.006091   \n",
       "4   5  0.162922 -0.377662  0.014457  0.565437 -0.203369 -0.511508  0.410961   \n",
       "\n",
       "          8         9  ...        5992      5993      5994      5995  \\\n",
       "0 -0.588421  0.455224  ...   -0.050761  0.220506  0.036548 -0.097461   \n",
       "1 -0.007302 -0.026286  ...    0.061333  0.107437  0.104516  0.063419   \n",
       "2  0.151471  0.137258  ...    4.272044 -1.991455 -2.922208  1.937039   \n",
       "3 -0.076751 -0.032893  ...    0.095025 -0.000406  0.091776  0.074314   \n",
       "4  0.228546 -0.515244  ...   -0.093563 -0.263632  0.114517  0.209541   \n",
       "\n",
       "       5996      5997      5998      5999      6000  label  \n",
       "0 -0.084060 -0.007716 -0.049949 -0.018274  0.021523      7  \n",
       "1 -0.014394 -0.048607 -0.009388  0.058830  0.129342      0  \n",
       "2  0.704156 -2.085667  0.203044  0.739892 -2.149829      9  \n",
       "3 -0.082842 -0.110050 -0.028020  0.025990 -0.050355      9  \n",
       "4 -0.184851 -0.075370  0.286211  0.005685 -0.223348      7  \n",
       "\n",
       "[5 rows x 6002 columns]"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.head(5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.目标值分布观察"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据量较少。但是分布还算均匀。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "label\n",
       "0    177\n",
       "1     46\n",
       "2     43\n",
       "3     50\n",
       "4     51\n",
       "5     47\n",
       "6     52\n",
       "7    140\n",
       "8     45\n",
       "9    141\n",
       "Name: label, dtype: int64"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_label_count = train_data.groupby(['label'])['label'].count()\n",
    "y_label_count"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "注意：同一列的数据不一定是同一个时间点的采样数据，即不要把每一列当作一个特征\n",
    "先看眼数据，啥也看不出来。数据比较完整，没有缺失，不用也不能进行填充等操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>10</th>\n",
       "      <th>...</th>\n",
       "      <th>5991</th>\n",
       "      <th>5992</th>\n",
       "      <th>5993</th>\n",
       "      <th>5994</th>\n",
       "      <th>5995</th>\n",
       "      <th>5996</th>\n",
       "      <th>5997</th>\n",
       "      <th>5998</th>\n",
       "      <th>5999</th>\n",
       "      <th>6000</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.563650</td>\n",
       "      <td>1.069229</td>\n",
       "      <td>-0.837759</td>\n",
       "      <td>-1.122021</td>\n",
       "      <td>0.433296</td>\n",
       "      <td>0.770755</td>\n",
       "      <td>-0.477153</td>\n",
       "      <td>-0.588421</td>\n",
       "      <td>0.455224</td>\n",
       "      <td>0.555122</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.150659</td>\n",
       "      <td>-0.050761</td>\n",
       "      <td>0.220506</td>\n",
       "      <td>0.036548</td>\n",
       "      <td>-0.097461</td>\n",
       "      <td>-0.084060</td>\n",
       "      <td>-0.007716</td>\n",
       "      <td>-0.049949</td>\n",
       "      <td>-0.018274</td>\n",
       "      <td>0.021523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.061333</td>\n",
       "      <td>0.058830</td>\n",
       "      <td>0.056952</td>\n",
       "      <td>0.068634</td>\n",
       "      <td>0.073433</td>\n",
       "      <td>0.072390</td>\n",
       "      <td>0.042975</td>\n",
       "      <td>-0.007302</td>\n",
       "      <td>-0.026286</td>\n",
       "      <td>-0.006050</td>\n",
       "      <td>...</td>\n",
       "      <td>0.033796</td>\n",
       "      <td>0.061333</td>\n",
       "      <td>0.107437</td>\n",
       "      <td>0.104516</td>\n",
       "      <td>0.063419</td>\n",
       "      <td>-0.014394</td>\n",
       "      <td>-0.048607</td>\n",
       "      <td>-0.009388</td>\n",
       "      <td>0.058830</td>\n",
       "      <td>0.129342</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.035736</td>\n",
       "      <td>0.010964</td>\n",
       "      <td>-0.164872</td>\n",
       "      <td>-0.167714</td>\n",
       "      <td>-0.125075</td>\n",
       "      <td>-0.104771</td>\n",
       "      <td>-0.016650</td>\n",
       "      <td>0.151471</td>\n",
       "      <td>0.137258</td>\n",
       "      <td>0.045076</td>\n",
       "      <td>...</td>\n",
       "      <td>1.151665</td>\n",
       "      <td>4.272044</td>\n",
       "      <td>-1.991455</td>\n",
       "      <td>-2.922208</td>\n",
       "      <td>1.937039</td>\n",
       "      <td>0.704156</td>\n",
       "      <td>-2.085667</td>\n",
       "      <td>0.203044</td>\n",
       "      <td>0.739892</td>\n",
       "      <td>-2.149829</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.046700</td>\n",
       "      <td>0.060913</td>\n",
       "      <td>0.009340</td>\n",
       "      <td>-0.093400</td>\n",
       "      <td>-0.067817</td>\n",
       "      <td>0.022335</td>\n",
       "      <td>0.006091</td>\n",
       "      <td>-0.076751</td>\n",
       "      <td>-0.032893</td>\n",
       "      <td>0.023553</td>\n",
       "      <td>...</td>\n",
       "      <td>0.137258</td>\n",
       "      <td>0.095025</td>\n",
       "      <td>-0.000406</td>\n",
       "      <td>0.091776</td>\n",
       "      <td>0.074314</td>\n",
       "      <td>-0.082842</td>\n",
       "      <td>-0.110050</td>\n",
       "      <td>-0.028020</td>\n",
       "      <td>0.025990</td>\n",
       "      <td>-0.050355</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.162922</td>\n",
       "      <td>-0.377662</td>\n",
       "      <td>0.014457</td>\n",
       "      <td>0.565437</td>\n",
       "      <td>-0.203369</td>\n",
       "      <td>-0.511508</td>\n",
       "      <td>0.410961</td>\n",
       "      <td>0.228546</td>\n",
       "      <td>-0.515244</td>\n",
       "      <td>0.013157</td>\n",
       "      <td>...</td>\n",
       "      <td>0.216039</td>\n",
       "      <td>-0.093563</td>\n",
       "      <td>-0.263632</td>\n",
       "      <td>0.114517</td>\n",
       "      <td>0.209541</td>\n",
       "      <td>-0.184851</td>\n",
       "      <td>-0.075370</td>\n",
       "      <td>0.286211</td>\n",
       "      <td>0.005685</td>\n",
       "      <td>-0.223348</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 6000 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          1         2         3         4         5         6         7  \\\n",
       "0  0.563650  1.069229 -0.837759 -1.122021  0.433296  0.770755 -0.477153   \n",
       "1  0.061333  0.058830  0.056952  0.068634  0.073433  0.072390  0.042975   \n",
       "2  0.035736  0.010964 -0.164872 -0.167714 -0.125075 -0.104771 -0.016650   \n",
       "3 -0.046700  0.060913  0.009340 -0.093400 -0.067817  0.022335  0.006091   \n",
       "4  0.162922 -0.377662  0.014457  0.565437 -0.203369 -0.511508  0.410961   \n",
       "\n",
       "          8         9        10    ...         5991      5992      5993  \\\n",
       "0 -0.588421  0.455224  0.555122    ...    -0.150659 -0.050761  0.220506   \n",
       "1 -0.007302 -0.026286 -0.006050    ...     0.033796  0.061333  0.107437   \n",
       "2  0.151471  0.137258  0.045076    ...     1.151665  4.272044 -1.991455   \n",
       "3 -0.076751 -0.032893  0.023553    ...     0.137258  0.095025 -0.000406   \n",
       "4  0.228546 -0.515244  0.013157    ...     0.216039 -0.093563 -0.263632   \n",
       "\n",
       "       5994      5995      5996      5997      5998      5999      6000  \n",
       "0  0.036548 -0.097461 -0.084060 -0.007716 -0.049949 -0.018274  0.021523  \n",
       "1  0.104516  0.063419 -0.014394 -0.048607 -0.009388  0.058830  0.129342  \n",
       "2 -2.922208  1.937039  0.704156 -2.085667  0.203044  0.739892 -2.149829  \n",
       "3  0.091776  0.074314 -0.082842 -0.110050 -0.028020  0.025990 -0.050355  \n",
       "4  0.114517  0.209541 -0.184851 -0.075370  0.286211  0.005685 -0.223348  \n",
       "\n",
       "[5 rows x 6000 columns]"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train = train_data.iloc[:,1:6001]\n",
    "X_train.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3.特征提取 提取和，均值，方差等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sum</th>\n",
       "      <th>abs_sum</th>\n",
       "      <th>per5</th>\n",
       "      <th>per95</th>\n",
       "      <th>per99</th>\n",
       "      <th>mean</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>std</th>\n",
       "      <th>var</th>\n",
       "      <th>median</th>\n",
       "      <th>skew</th>\n",
       "      <th>kurtosis</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>28.589395</td>\n",
       "      <td>2154.024642</td>\n",
       "      <td>-1.004296</td>\n",
       "      <td>0.971362</td>\n",
       "      <td>1.892394</td>\n",
       "      <td>0.004765</td>\n",
       "      <td>-3.003019</td>\n",
       "      <td>3.236114</td>\n",
       "      <td>0.583343</td>\n",
       "      <td>0.340289</td>\n",
       "      <td>0.007919</td>\n",
       "      <td>0.000519</td>\n",
       "      <td>4.984610</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>91.983113</td>\n",
       "      <td>325.233054</td>\n",
       "      <td>-0.098466</td>\n",
       "      <td>0.119537</td>\n",
       "      <td>0.160219</td>\n",
       "      <td>0.015331</td>\n",
       "      <td>-0.222801</td>\n",
       "      <td>0.221132</td>\n",
       "      <td>0.065739</td>\n",
       "      <td>0.004322</td>\n",
       "      <td>0.017524</td>\n",
       "      <td>-0.205528</td>\n",
       "      <td>0.036342</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>19.617697</td>\n",
       "      <td>1605.012177</td>\n",
       "      <td>-0.637192</td>\n",
       "      <td>0.628238</td>\n",
       "      <td>1.901311</td>\n",
       "      <td>0.003270</td>\n",
       "      <td>-5.501272</td>\n",
       "      <td>5.912233</td>\n",
       "      <td>0.540327</td>\n",
       "      <td>0.291954</td>\n",
       "      <td>0.002843</td>\n",
       "      <td>0.231480</td>\n",
       "      <td>21.957896</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>24.154104</td>\n",
       "      <td>955.968911</td>\n",
       "      <td>-0.277378</td>\n",
       "      <td>0.313520</td>\n",
       "      <td>1.300825</td>\n",
       "      <td>0.004026</td>\n",
       "      <td>-3.955295</td>\n",
       "      <td>3.712455</td>\n",
       "      <td>0.366301</td>\n",
       "      <td>0.134176</td>\n",
       "      <td>0.003249</td>\n",
       "      <td>-0.492159</td>\n",
       "      <td>34.973034</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>79.547894</td>\n",
       "      <td>976.343474</td>\n",
       "      <td>-0.332667</td>\n",
       "      <td>0.357910</td>\n",
       "      <td>0.703714</td>\n",
       "      <td>0.013258</td>\n",
       "      <td>-1.754299</td>\n",
       "      <td>1.550606</td>\n",
       "      <td>0.233977</td>\n",
       "      <td>0.054745</td>\n",
       "      <td>0.010802</td>\n",
       "      <td>-0.048808</td>\n",
       "      <td>5.036917</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         sum      abs_sum      per5     per95     per99      mean       min  \\\n",
       "0  28.589395  2154.024642 -1.004296  0.971362  1.892394  0.004765 -3.003019   \n",
       "1  91.983113   325.233054 -0.098466  0.119537  0.160219  0.015331 -0.222801   \n",
       "2  19.617697  1605.012177 -0.637192  0.628238  1.901311  0.003270 -5.501272   \n",
       "3  24.154104   955.968911 -0.277378  0.313520  1.300825  0.004026 -3.955295   \n",
       "4  79.547894   976.343474 -0.332667  0.357910  0.703714  0.013258 -1.754299   \n",
       "\n",
       "        max       std       var    median      skew   kurtosis  label  \n",
       "0  3.236114  0.583343  0.340289  0.007919  0.000519   4.984610      7  \n",
       "1  0.221132  0.065739  0.004322  0.017524 -0.205528   0.036342      0  \n",
       "2  5.912233  0.540327  0.291954  0.002843  0.231480  21.957896      9  \n",
       "3  3.712455  0.366301  0.134176  0.003249 -0.492159  34.973034      9  \n",
       "4  1.550606  0.233977  0.054745  0.010802 -0.048808   5.036917      7  "
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train_trans = pd.DataFrame()\n",
    "X_train_trans['sum'] = np.sum(X_train,axis =1)\n",
    "X_train_trans['abs_sum'] = np.sum(np.abs(X_train),axis =1)\n",
    "X_train_trans['per5'] = np.percentile(X_train,q=5,axis =1) \n",
    "X_train_trans['per95'] = np.percentile(X_train,q=95,axis =1) \n",
    "X_train_trans['per99'] = np.percentile(X_train,q=99,axis =1) \n",
    "\n",
    "X_train_trans['mean'] = np.mean(X_train,axis =1)\n",
    "X_train_trans['min'] = np.min(X_train,axis =1)\n",
    "X_train_trans['max'] = np.max(X_train,axis =1)\n",
    "X_train_trans['std'] = np.std(X_train,axis =1)\n",
    "X_train_trans['var'] = np.var(X_train,axis =1)\n",
    "X_train_trans['median'] = np.median(X_train,axis =1)\n",
    "X_train_trans['skew'] = stats.skew(X_train,axis =1)\n",
    "X_train_trans['kurtosis'] = stats.kurtosis(X_train,axis =1)  \n",
    "X_train_trans['label'] =train_data['label']\n",
    "\n",
    "y = pd.DataFrame()\n",
    "y['label'] =train_data['label']\n",
    "X_train_trans.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从转换后的特征来看，不同label的数据还是比较有区分度的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>sum</th>\n",
       "      <th>abs_sum</th>\n",
       "      <th>per5</th>\n",
       "      <th>per95</th>\n",
       "      <th>per99</th>\n",
       "      <th>mean</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>std</th>\n",
       "      <th>var</th>\n",
       "      <th>median</th>\n",
       "      <th>skew</th>\n",
       "      <th>kurtosis</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>20.936670</td>\n",
       "      <td>1593.757047</td>\n",
       "      <td>-0.583690</td>\n",
       "      <td>0.584421</td>\n",
       "      <td>2.087291</td>\n",
       "      <td>0.003489</td>\n",
       "      <td>-4.631026</td>\n",
       "      <td>5.202391</td>\n",
       "      <td>0.537096</td>\n",
       "      <td>0.288472</td>\n",
       "      <td>0.003249</td>\n",
       "      <td>-0.019100</td>\n",
       "      <td>17.459809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>36.363946</td>\n",
       "      <td>3711.522106</td>\n",
       "      <td>-1.285755</td>\n",
       "      <td>1.312496</td>\n",
       "      <td>2.201414</td>\n",
       "      <td>0.006061</td>\n",
       "      <td>-2.891751</td>\n",
       "      <td>3.168703</td>\n",
       "      <td>0.809820</td>\n",
       "      <td>0.655808</td>\n",
       "      <td>-0.003452</td>\n",
       "      <td>0.085543</td>\n",
       "      <td>1.154068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>39.485544</td>\n",
       "      <td>984.972515</td>\n",
       "      <td>-0.299287</td>\n",
       "      <td>0.312749</td>\n",
       "      <td>1.293028</td>\n",
       "      <td>0.006581</td>\n",
       "      <td>-3.624334</td>\n",
       "      <td>3.813977</td>\n",
       "      <td>0.361151</td>\n",
       "      <td>0.130430</td>\n",
       "      <td>0.006497</td>\n",
       "      <td>-0.474609</td>\n",
       "      <td>30.183324</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>57.501702</td>\n",
       "      <td>311.344067</td>\n",
       "      <td>-0.097423</td>\n",
       "      <td>0.109940</td>\n",
       "      <td>0.148328</td>\n",
       "      <td>0.009584</td>\n",
       "      <td>-0.243246</td>\n",
       "      <td>0.197559</td>\n",
       "      <td>0.063453</td>\n",
       "      <td>0.004026</td>\n",
       "      <td>0.011891</td>\n",
       "      <td>-0.156539</td>\n",
       "      <td>-0.127848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>26.891785</td>\n",
       "      <td>733.222105</td>\n",
       "      <td>-0.241866</td>\n",
       "      <td>0.261204</td>\n",
       "      <td>0.358509</td>\n",
       "      <td>0.004482</td>\n",
       "      <td>-0.518818</td>\n",
       "      <td>0.556503</td>\n",
       "      <td>0.152550</td>\n",
       "      <td>0.023271</td>\n",
       "      <td>0.003411</td>\n",
       "      <td>0.046709</td>\n",
       "      <td>-0.115646</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   id        sum      abs_sum      per5     per95     per99      mean  \\\n",
       "0   1  20.936670  1593.757047 -0.583690  0.584421  2.087291  0.003489   \n",
       "1   2  36.363946  3711.522106 -1.285755  1.312496  2.201414  0.006061   \n",
       "2   3  39.485544   984.972515 -0.299287  0.312749  1.293028  0.006581   \n",
       "3   4  57.501702   311.344067 -0.097423  0.109940  0.148328  0.009584   \n",
       "4   5  26.891785   733.222105 -0.241866  0.261204  0.358509  0.004482   \n",
       "\n",
       "        min       max       std       var    median      skew   kurtosis  \n",
       "0 -4.631026  5.202391  0.537096  0.288472  0.003249 -0.019100  17.459809  \n",
       "1 -2.891751  3.168703  0.809820  0.655808 -0.003452  0.085543   1.154068  \n",
       "2 -3.624334  3.813977  0.361151  0.130430  0.006497 -0.474609  30.183324  \n",
       "3 -0.243246  0.197559  0.063453  0.004026  0.011891 -0.156539  -0.127848  \n",
       "4 -0.518818  0.556503  0.152550  0.023271  0.003411  0.046709  -0.115646  "
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_trans = pd.DataFrame()\n",
    "test_trans['id'] = test_data['id']\n",
    "test_trans['sum'] = np.sum(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['abs_sum'] = np.sum(np.abs(test_data.iloc[:,1:6001]),axis =1)\n",
    "test_trans['per5'] = np.percentile(test_data.iloc[:,1:6001],q=5,axis =1) \n",
    "test_trans['per95'] = np.percentile(test_data.iloc[:,1:6001],q=95,axis =1) \n",
    "test_trans['per99'] = np.percentile(test_data.iloc[:,1:6001],q=99,axis =1) \n",
    "test_trans['mean'] = np.mean(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['min'] = np.min(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['max'] = np.max(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['std'] = np.std(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['var'] = np.var(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['median'] = np.median(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['skew'] = stats.skew(test_data.iloc[:,1:6001],axis =1)\n",
    "test_trans['kurtosis'] = stats.kurtosis(test_data.iloc[:,1:6001],axis =1) \n",
    "test_trans.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.分类分布查看"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画一个分类散点图，看看分布情况。pca降到2维画平面图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.99591646 0.00398554]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.decomposition import PCA\n",
    "var=[\"sum\",\"abs_sum\",\"per5\",\"per95\",\"per99\",\"mean\",\"min\",\"max\",\"std\",\"var\",\"median\",\"skew\",\"kurtosis\"]\n",
    "pca = PCA(n_components=2)\n",
    "pca.fit(X_train_trans[var])\n",
    "X_pca=pca.transform(X_train_trans[var])\n",
    "print(pca.explained_variance_ratio_)  \n",
    "X_pca_df =pd.DataFrame(X_pca) \n",
    "pic_x=pd.concat([X_pca_df,y],axis=1) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X14nNV95//3d0YayR4Hy8LjBwT2yOBgE0NsLLCbLDQE8+R2KydtuHB/V3FBW+gm9Adk0y1JC9uG3SRNfr+QZNNNTGI2Trc1SdqAvEAgPKWQbDCWMWATQzC2DJYFCIwAjy1Lmjn7x32PPJpnSSNpZvR5XZeumTlze+7jsfydM9/7e84x5xwiIlK9ApPdARERGV8K9CIiVU6BXkSkyinQi4hUOQV6EZEqp0AvIlLlFOhFRKqcAr2ISJVToBcRqXI1k90BgNmzZ7toNDrZ3RARqSg7dux4yzkXKXRcWQT6aDRKR0fHZHdDRKSimNmBYo5T6kZEpMop0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ZCvXxPOOXfIv33TzO7B+2V+w8zmO+e6/a/wb/qHT1bfR9qfg8DH0tp/MZ4ddM69kbxfDr+HZlaLF0D/yTn3U7+5rN7HbH0st/cxyTnXa2a/wMvRN5hZjT9qTz1fso8HzawGmImX4hvV/5spN6LPJy1H/AkgWQmxFbjKvxLeDCwGnga2A4v9K+chvIsmWyewy5N9/iFmFjazDyTvA5fivX9bgWSFxQag3b+/Fbjar9JYDbybTAWMs5H25yHgUjOb5X/1v9RvGzfl9Hvo54U3AXucc19Peaps3sdcfSyz9zFiZg3+/WnAGrxrCY8Df+Qflv4+Jt/fPwIec97V2Fx9z68UV5Sr5Qf4R2AX8Lz/hs5Pee6v8XJqLwFXpLSvxbvK/wrw15PQ50k9f0o/FuFVAzwHvJDsC15e8VHgZf+20W834B/8fu8CWsahT1vwvrIP4I2E2kbTH+BavItee4FrJqCPZfN7CPw7vNTA88Cz/s/acnof8/SxnN7Hc4Cdfl92A7el/L952n9PfgLU+e31/uO9/vOLCvU9349mxoqIVDmlbkREqpwCvYhIlVOgFxGpcgr0IiJVToFeRKTKKdCLiFQ5BXoRkSqnQC8iUuX+L7foaDW5xoFkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "colors=['blue','orange','green','red','purple','brown','pink','gray','olive','cyan'] \n",
    "for i in range(0,10):\n",
    "    Xi=pic_x[pic_x['label']==i][0]\n",
    "    yi=pic_x[pic_x['label']==i][1]\n",
    "    plt.scatter(Xi, yi, s=20, c=colors[i], label=i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbW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DP5338H/xXdsnQfgHeHfr8an7fP3L+FonsyxkynbabiQtTPvG/hl/E/gTvyLdwJ/GIrEFPawTn3upndDOzI7/cZ59zrc3vJDXERhekcnHPkyrkjAAAAe0lEQVTPmtn9wHPAJHClc24KwMzW4kcwtAObnHPPzvH1NsImYJOZ/TtwAFjt/P/mLN2HW83sJHw6Ygy4FDL5byFO1uLCLJppKyKSEa0+SkdERCqkgC8ikhEK+CIiGaGALyKSEQr4IiIZoYAvIpIRCvgiIhmhgC8ikhH/D/vQTrDhGEPJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "state_list=[0,1]\n",
    "for i in state_list:\n",
    "    Xi=pic_x[pic_x['label']==i][0]\n",
    "    yi=pic_x[pic_x['label']==i][1]\n",
    "    plt.scatter(Xi, yi, s=20, c=colors[i], label=i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHr5JREFUeJzt3X+UXGWd5/H3t3+l+zTGBChMJiFUOItz+DG7E+kEXFcUCMsPHcMyypLjcUH6bMKsOMCuZxSiOCvDHGbmrIiDI2SnGcCdaWRQCasoEAHZ2SP5wW8wiwnYgQBKqYASu9O/vvvHvZW+3X3rR1fV7fpxP69z6lTVc2/d+9RTVd/73Od57lPm7oiISOtrq3cGRERkfijgi4ikhAK+iEhKKOCLiKSEAr6ISEoo4IuIpIQCvohISijgi4ikhAK+iEhKdNRqQ2bWDuwEXnH3D5vZSuAO4FDgceAT7j5abBuHH364Z7PZW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ekbQXvej2akHc/0zrMXCTpXOsLHK5nqYDk+oXxdAnwpfPxugtM+AzJAe5h+NPAKcGj4fAdBjTvf8XhOguVWKH+NUHZLI4+vIGgXp4HKrlD+6l52M/I5xFSn6BKmrslZA7wUllVd8haTvw8xvdN2e5h+KPAzgrPRxeHjQxPM0zGRx58G7mrU8iv4Huq583n40twKXBKTvomg9/x5IiM2CEYD/DRctinBfHUB/wt4luB08LQw/Y+B58IvxuPAH0Ve0xeu/wJwY/4LNp/5a5Cy+wbwDPA0cE8+wDZQ2cXmrxHKbkY+owH10kjZPQr823rmLSZ/BnwtzMMzQF9kvYsJOsD3AJ9MOE/fCr9HTwP/G1jWqOVX6KYrbUVEUiINo3RERAQFfBGR1FDAFxFJCQV8EZGUUMAXEUkJBXwRkZRQwBcRSQkFfBGRlPj/NO0jUOeFXz8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "state_list=[1,2]\n",
    "for i in state_list:\n",
    "    Xi=pic_x[pic_x['label']==i][0]\n",
    "    yi=pic_x[pic_x['label']==i][1]\n",
    "    plt.scatter(Xi, yi, s=20, c=colors[i], label=i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从上面的图可以看出来，正常状态和异常状态区分度很好。但1-9异常状态间区分度不太好。说明选取的特征还不够，有时间继续探索补充特征吧。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 5.分类算法，直接用随机森林"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[39  0  0  0  0  0  0  0  0  0]\n",
      " [ 0 17  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  4  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  5  0  0  0  0  0  0]\n",
      " [ 0  0  0  0 11  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  9  0  0  0  0]\n",
      " [ 0  0  0  0  0  0 12  0  0  0]\n",
      " [ 0  0  0  0  0  0  0 22  0  1]\n",
      " [ 0  0  0  0  0  0  0  0 11  0]\n",
      " [ 0  0  0  0  0  0  0  0  0 28]]\n",
      "0.9937106918238994\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import confusion_matrix, accuracy_score\n",
    "clf = RandomForestClassifier(n_estimators=50)\n",
    "var=[\"sum\",\"abs_sum\",\"per5\",\"per95\",\"per99\",\"mean\",\"min\",\"max\",\"std\",\"var\",\"median\",\"skew\",\"kurtosis\"]\n",
    "x_train, x_val, y_train, y_val = train_test_split(X_train_trans[var], y , test_size=0.2)\n",
    "clf.fit(x_train, y_train)\n",
    "print(confusion_matrix(y_val, clf.predict(x_val)))\n",
    "print(accuracy_score(y_val, clf.predict(x_val)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[39  0  0  0  0  0  0  0  0  0]\n",
      " [ 0 16  0  1  0  0  0  0  0  0]\n",
      " [ 0  0  4  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  5  0  0  0  0  0  0]\n",
      " [ 0  0  0  0 11  0  0  0  0  0]\n",
      " [ 0  0  1  0  0  8  0  0  0  0]\n",
      " [ 0  0  0  0  0  0 12  0  0  0]\n",
      " [ 0  0  0  0  0  0  0 23  0  0]\n",
      " [ 0  0  0  0  0  0  0  0 11  0]\n",
      " [ 0  0  0  0  0  0  0  0  0 28]]\n",
      "0.9874213836477987\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import GradientBoostingClassifier \n",
    "gb_clf = GradientBoostingClassifier(n_estimators=50) \n",
    "gb_clf.fit(x_train, y_train)\n",
    "print(confusion_matrix(y_val, gb_clf.predict(x_val)))\n",
    "print(accuracy_score(y_val, gb_clf.predict(x_val)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "分别用了随机森林和梯度boosting，效果都不错，但是因为样本量很少，准确率在95%-99%之间吧。长传dcrace上结果97%"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [],
   "source": [
    "clf.fit(X_train_trans[var], y )\n",
    "y_test=clf.predict(test_trans[var]) \n",
    "test_trans['label']=y_test\n",
    "test_trans.to_csv(\"D:\\\\GIT\\\\ml_dl\\\\ml\\\\classify\\\\bearing\\\\sample.csv\",index=0,header=1,columns=['id','label'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
